package scantask.containers;

import scantask.containers.exceptions.IllegalBenchmarkNameException;
import scantask.containers.exceptions.UnInitializeObjectException;

public class Benchmark {
	
	private String _name;
	private Coordinate _coordinate;
	
	public Benchmark(String name, Coordinate coordinate) throws IllegalBenchmarkNameException, UnInitializeObjectException {
		if (name.compareTo("") == 0) {
			scantask.server.utilities.logging.SingletonLogger.getLogger().warning("Failed construct new Benchmark illegale name");
			scantask.client.utilities.logging.SingletonLogger.getLogger().warning("Failed construct new Benchmark illegale name");
			throw new IllegalBenchmarkNameException();
		}
		if (coordinate == null) {
			scantask.server.utilities.logging.SingletonLogger.getLogger().warning("Failed construct new Benchmark null coordinate");
			scantask.client.utilities.logging.SingletonLogger.getLogger().warning("Failed construct new Benchmark null coordinate");
			throw new UnInitializeObjectException();
		}
		
		this._name = name;
		this._coordinate = coordinate;
	}
	
	public String getName() {
		return this._name;
	}
	
	public Coordinate getCoordinate() {
		return this._coordinate;
	}
	
	public void setName(String name) throws IllegalBenchmarkNameException {
		if (name.compareTo("") == 0) {
			scantask.server.utilities.logging.SingletonLogger.getLogger().warning("Failed set Benchmark name, illegale name");
			scantask.client.utilities.logging.SingletonLogger.getLogger().warning("Failed set Benchmark name, illegale name");
			throw new IllegalBenchmarkNameException();
		}
		
		this._name = name;
	}
	
	public void setCoordinate(Coordinate coordinate) throws UnInitializeObjectException {
		if (coordinate == null) {
			scantask.server.utilities.logging.SingletonLogger.getLogger().warning("Failed set Benchmark coordinate, null coordinate");
			scantask.client.utilities.logging.SingletonLogger.getLogger().warning("Failed set Benchmark coordinate, null coordinate");
			throw new UnInitializeObjectException();
		}
		
		this._coordinate = coordinate;
	}
	

}
